package com.yyy.dm;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class CommonResponse<T> implements Serializable {
    private String success;
    private String errorCode;
    private String msg;
    private T data;

    public CommonResponse(T data){
        this.success = "success";
        this.errorCode = "0000";
        this.msg = "";
        this.data = data;
    }
    public CommonResponse(T data,String msg){
        this.success = "success";
        this.errorCode = "0000";
        this.msg = msg;
        this.data = data;
    }

    public CommonResponse(String errorCode, String msg){
        this.errorCode = errorCode;
        this.msg = msg;
    }

}